#include <iostream>
#include <string>
using namespace std;

int main()
{
    string s1, s2;
    getline(cin, s1);
    getline(cin ,s2);
    char hash[256] = {0};
    for(size_t i = 0; i < s2.size(); ++i){
        hash[s2[i]] += 1;
    }
    string res;
    for(size_t i = 0; i < s1.size(); ++i){
        if(hash[s1[i]] == 0) res.push_back(s1[i]);
    }
    cout << res << endl;
    return 0;
}